<?php
/**
 * #Celebrate Shieh
 *             ,%%%%%%%%,
 *           ,%%/\%%%%/\%%
 *          ,%%%\c "" J/%%%
 * %.       %%%%/ o  o \%%%
 * `%%.     %%%%    _  |%%%
 *  `%%     `%%%%(__Y__)%%'
 *  //       ;%%%%`\-/%%%'
 * ((       /  `%%%%%%%'
 *  \\    .'          |
 *   \\  /       \  | |
 *    \\/         ) | |
 *     \         /_ | |__
 *     (___________))))))) 攻城湿
 *
 *        _       _
 * __   _(_)_   _(_) __ _ _ __
 * \ \ / / \ \ / / |/ _` |'_ \
 *  \ V /| |\ V /| | (_| | | | |
 *   \_/ |_| \_/ |_|\__,_|_| |_|
 */

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your module. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

use Illuminate\Support\Facades\Route;

/********************博客管理***************************/
Route::group([ 'prefix' => 'blog', 'middleware' => [ 'logMongoBlog' ] ], function () {
    /****************************游客******************************/
    Route::post('code', 'HomeController@code');//获取邮箱验证码
    Route::get('publicData', 'HomeController@publicData');//获取公共数据 省市区 配置
    Route::post('login', 'UserController@store');//登陆
    Route::get('wxQrCode', 'UserController@WxQrCode');//获取微信二维码

    /****************************会员******************************/
    Route::group([ 'middleware' => [ 'jwt.api.auth' ] ], function () {
        /****************************上传******************************/
        Route::post('upload', 'HomeController@upload');//上传文件

        /****************************用户******************************/
        Route::get('user', 'UserController@user');//自己用户信息
        Route::put('user', 'UserController@update');//修改个人信息
        Route::patch('password', 'UserController@password');//修改密码
        Route::get('logout', 'UserController@logout');//退出登陆

        /****************************文章******************************/
        Route::get('articleDetails', 'ArticleController@articleDetails');//获取最新10条文章
        Route::get('articleEchart', 'ArticleController@articleEchart');//获取文章图表信息
        Route::get('article', 'ArticleController@article');//获取最新10条文章
        Route::get('articleTable', 'ArticleController@index');//获取文章列表
        Route::post('article', 'ArticleController@create');//创建文章
        Route::get('article/{article}', 'ArticleController@show');//获取文章详情
        Route::put('article/{article}', 'ArticleController@update');//修改文章
        Route::patch('article/{article}', 'ArticleController@is_show');//修改文章状态
        Route::delete('article/{article}', 'ArticleController@destroy');//删除文章
        Route::post('articleDelete', 'ArticleController@delete');//批量删除文章

        /****************************分类******************************/
        Route::get('category', 'CategoryController@index');//获取分类

        /****************************标签******************************/
        Route::get('label', 'LabelController@index');//获取标签
        Route::get('labelTable', 'LabelController@labelTable');//获取标签列表
        Route::patch('label/{label}', 'LabelController@is_show');//修改标签状态
        Route::get('label/{label}', 'LabelController@show');//获取标签详情
        Route::put('label/{label}', 'LabelController@update');//更新标签
        Route::post('label', 'LabelController@create');//新增标签
        Route::delete('label/{label}', 'LabelController@destroy');//删除标签
        Route::post('labelDelete', 'LabelController@delete');//批量删除标签

        /****************************菜单******************************/
        Route::get('list', 'ListController@index');//获取菜单
        Route::patch('list', 'ListController@update');//设置自己的菜单

        /****************************友情链接******************************/
        Route::get('link', 'LinkController@index');//获取链接
        Route::post('link', 'LinkController@create');//新增链接
        Route::patch('link/{link}', 'LinkController@is_show');//修改链接状态
        Route::get('link/{link}', 'LinkController@show');//获取链接详情
        Route::put('link/{link}', 'LinkController@update');//更新链接
        Route::delete('link/{link}', 'LinkController@destroy');//删除链接
        Route::post('linkDelete', 'LinkController@delete');//批量删除链接

        /****************************公告******************************/
        Route::get('notice', 'NoticeController@index');//获取公告
        Route::post('notice', 'NoticeController@create');//新增公告
        Route::patch('notice/{notice}', 'NoticeController@is_show');//修改公告状态
        Route::get('notice/{notice}', 'NoticeController@show');//获取公告详情
        Route::put('notice/{notice}', 'NoticeController@update');//更新公告
        Route::delete('notice/{notice}', 'NoticeController@destroy');//删除公告
        Route::post('noticeDelete', 'NoticeController@delete');//批量删除公告

        /****************************消息******************************/
        Route::get('news', 'MessageController@message');//获取最新消息
        Route::patch('message', 'MessageController@store');//消息已读
        Route::get('message', 'MessageController@index');//消息

        /****************************搜索纪录******************************/
        Route::get('search', 'SearchController@index');//获取搜索纪录
        Route::patch('search/{search}', 'SearchController@status');//修改状态
        Route::delete('search/{search}', 'SearchController@destroy');//删除
        Route::post('searchDelete', 'SearchController@delete');//批量删除

        /****************************意见反馈******************************/
        Route::get('feedback', 'FeedbackController@index');//获取意见反馈
        Route::delete('feedback/{feedback}', 'FeedbackController@destroy');//删除
        Route::post('feedbackDelete', 'FeedbackController@delete');//批量删除

        /****************************图片集锦******************************/
        Route::get('gallery', 'GalleryController@index');//获取图片集锦
        Route::post('gallery', 'GalleryController@create');//创建
        Route::get('gallery/{gallery}', 'GalleryController@show');//获取详情
        Route::put('gallery/{gallery}', 'GalleryController@update');//修改
        Route::patch('gallery/{gallery}', 'GalleryController@is_show');//修改状态
        Route::delete('gallery/{gallery}', 'GalleryController@destroy');//删除
        Route::post('galleryDelete', 'GalleryController@delete');//批量删除

        /****************************系统素材库 or 我的素材库******************************/
        Route::get('material', 'MaterialController@index');//获取素材
        Route::post('material', 'MaterialController@create');//创建
        Route::delete('material/{material}', 'MaterialController@destroy');//删除
        Route::post('materialDelete', 'MaterialController@delete');//批量删除

        /****************************我上传的文件******************************/
        Route::get('file', 'FileController@index');//获取图片集锦
        Route::delete('file/{file}', 'FileController@destroy');//删除
        Route::post('fileDelete', 'FileController@delete');//批量删除
    });
});
